<template>
	<view>
		<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :up="upOption" >
			<view class="p-l-30 p-r-30 p-t-10">
				<carry-item v-for="item in list" :item="item" type="30" ></carry-item>
			</view>
			
		</mescroll-body>		
	</view>
</template>

<script>
	import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins";
	import {carryPool} from '@/api/carry'
	
	export default {
		mixins: [MescrollMixin],
		data() {
			return {
				upOption: {
					auto: false,
					empty: {
						icon: '/static/images/news_null.png',
						tip: "暂无数据",
					}
				},
				list:[],
			}
		},
		methods: {
			upCallback(page) {
				carryPool({
					page:page.num,
					limit:page.size
				}).then(({
					data
				}) => {
					if (page.num == 1) this.list = [];
					let curPageData = data.lists;
					let curPageLen = curPageData.length;
					let totalSize = data.count;
					this.list = this.list.concat(curPageData);
					this.mescroll.endBySize(curPageLen, totalSize)
				}).catch(() => {
					this.mescroll.endErr()
				})
				
			},
		}
	}
</script>

<style>

</style>
